﻿CREATE PROCEDURE [dbo].[yaf_system_initialize](
                @Name       NVARCHAR(50),
                @TimeZone   INT,
                @ForumEmail NVARCHAR(50),
                @SmtpServer NVARCHAR(50),
                @User       NVARCHAR(50),
                @UserEmail  NVARCHAR(50),
                @Password   NVARCHAR(32))
AS
    BEGIN
        DECLARE  @tmpValue  AS NVARCHAR(100)
        -- initalize required 'registry' settings
        EXEC yaf_registry_save
             'Version' ,
             '1'
        EXEC yaf_registry_save
             'VersionName' ,
             '1.0.0'
        SET @tmpValue = CAST(@TimeZone AS NVARCHAR(100))
        EXEC yaf_registry_save
             'TimeZone' ,
             @tmpValue
        EXEC yaf_registry_save
             'SmtpServer' ,
             @SmtpServer
        EXEC yaf_registry_save
             'ForumEmail' ,
             @ForumEmail
        -- initalize new board
        EXEC yaf_board_create
             @Name ,
             0 ,
             @User ,
             @UserEmail ,
             @Password ,
             1
    END


